<template>
  <div>
    <el-button icon="el-icon-delete" plain circle type="danger" @click="delUser(id)"></el-button>
   </div>
</template>

<script>
export default {
  name: 'removeBtn-page',
  props: ['id'],
  methods: {
    delUser (id) {
      this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        await this.$emit('remove', { id })
        this.$message({
          type: 'success',
          message: '删除成功!'
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    }
  }
}
</script>

<style scoped>

</style>